export const name = 'sdp_sql'
export const module = 'sdp_sql'
export const title = 'SdpSql'

import { ref } from 'vue'
export function init(self) {
  let columns = [
  ]
  if (columns.length == 0) {
    columns = [
      {
        prop: 'id',
        label: 'id',
      },
      {
        prop: 'is_disable',
        label: 'is_disable',
      },
      {
        prop: 'workspace_name',
        label: 'workspace_name',
        sort_by_gbk: true,
      },
      {
        prop: 'table_name',
        label: 'table_name',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_catalog',
        label: 'parameter_catalog',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_catalog_type',
        label: 'parameter_catalog_type',
        sort_by_gbk: true,
      },
      {
        prop: 'name',
        label: 'name',
        sort_by_gbk: true,
      },
      {
        prop: 'java_type',
        label: 'java_type',
        sort_by_gbk: true,
      },
      {
        prop: 'remarks',
        label: 'remarks',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_mode',
        label: 'parameter_mode',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_nullable',
        label: 'parameter_nullable',
      },
      {
        prop: 'parameter_is_like',
        label: 'parameter_is_like',
      },
      {
        prop: 'parameter_is_import_excel',
        label: 'parameter_is_import_excel',
      },
      {
        prop: 'parameter_is_export_excel',
        label: 'parameter_is_export_excel',
      },
      {
        prop: 'parameter_sql_value_item',
        label: 'parameter_sql_value_item',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_sql_value',
        label: 'parameter_sql_value',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_sql_value_ignore',
        label: 'parameter_sql_value_ignore',
      },
      {
        prop: 'parameter_without_test',
        label: 'parameter_without_test',
      },
      {
        prop: 'parameter_sql_issimple',
        label: 'parameter_sql_issimple',
      },
      {
        prop: 'parameter_sql_return_nolist',
        label: 'parameter_sql_return_nolist',
      },
      {
        prop: 'java_imports',
        label: 'java_imports',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_overwrite_default_sql',
        label: 'parameter_overwrite_default_sql',
      },
      {
        prop: 'java_return_type',
        label: 'java_return_type',
        sort_by_gbk: true,
      },
      {
        prop: 'sort_no',
        label: 'sort_no',
      },
      {
        prop: 'remark',
        label: 'remark',
        sort_by_gbk: true,
      },
      {
        prop: 'is_interface',
        label: 'is_interface',
      },
      {
        prop: 'project_names',
        label: '项目名',
        sort_by_gbk: true,
      },
      {
        prop: 'parameter_sql',
        label: 'parameter_sql',
        sort_by_gbk: true,
      },
      {
        prop: 'java_body',
        label: 'java_body',
        sort_by_gbk: true,
      },
      {
        prop: 'extra_info',
        label: 'extra_info',
        sort_by_gbk: true,
      },
    ]
  }
  const obj = {
    name,
    module,
    title,
    columns,
    editColumns: [
      {
        prop: 'id',
        label: 'id',
        disabled: true,
      },
      {
        prop: 'is_disable',
        label: 'is_disable',
      },
      {
        prop: 'workspace_name',
        label: 'workspace_name',
      },
      {
        prop: 'table_name',
        label: 'table_name',
      },
      {
        prop: 'parameter_catalog',
        label: 'parameter_catalog',
      },
      {
        prop: 'parameter_catalog_type',
        label: 'parameter_catalog_type',
      },
      {
        prop: 'name',
        label: 'name',
      },
      {
        prop: 'java_type',
        label: 'java_type',
      },
      {
        prop: 'remarks',
        label: 'remarks',
      },
      {
        prop: 'parameter_mode',
        label: 'parameter_mode',
      },
      {
        prop: 'parameter_nullable',
        label: 'parameter_nullable',
      },
      {
        prop: 'parameter_is_like',
        label: 'parameter_is_like',
      },
      {
        prop: 'parameter_is_import_excel',
        label: 'parameter_is_import_excel',
      },
      {
        prop: 'parameter_is_export_excel',
        label: 'parameter_is_export_excel',
      },
      {
        prop: 'parameter_sql_value_item',
        label: 'parameter_sql_value_item',
      },
      {
        prop: 'parameter_sql_value',
        label: 'parameter_sql_value',
      },
      {
        prop: 'parameter_sql_value_ignore',
        label: 'parameter_sql_value_ignore',
      },
      {
        prop: 'parameter_without_test',
        label: 'parameter_without_test',
      },
      {
        prop: 'parameter_sql_issimple',
        label: 'parameter_sql_issimple',
      },
      {
        prop: 'parameter_sql_return_nolist',
        label: 'parameter_sql_return_nolist',
      },
      {
        prop: 'java_imports',
        label: 'java_imports',
      },
      {
        prop: 'parameter_overwrite_default_sql',
        label: 'parameter_overwrite_default_sql',
      },
      {
        prop: 'java_return_type',
        label: 'java_return_type',
      },
      {
        prop: 'sort_no',
        label: 'sort_no',
      },
      {
        prop: 'remark',
        label: 'remark',
      },
      {
        prop: 'is_interface',
        label: 'is_interface',
      },
      {
        prop: 'project_names',
        label: '项目名',
      },
      {
        prop: 'parameter_sql',
        label: 'parameter_sql',
      },
      {
        prop: 'java_body',
        label: 'java_body',
      },
      {
        prop: 'extra_info',
        label: 'extra_info',
      },
    ],

    queryColumns: [
    ],

    remoteConfig: {
      count: {module, method: 'count'},
      list: {module, method: 'list'},
      export_excel: {module, method: 'export_excel'},
      edit: {module, method: 'update', keys: [
        'id',
      ]},
      add: {module, method:'add'},
      delete: {module, method: 'delete', keys: [
        'id',
      ]},
    }
  }
  for(let p in obj) {
    self[p] = ref(obj[p])
  }
}
